package com.gitee.minimalismstyle.fresh.common.web.controller

import com.gitee.minimalismstyle.fresh.common.core.domain.SnowflakeIdWorker
import io.swagger.annotations.Api
import io.swagger.annotations.ApiOperation
import org.springframework.web.bind.annotation.*

@Api(value = "snowflakeId", tags = ["snowflakeId生成器"])
@RestController
@RequestMapping("snowflakeId")
class SnowflakeIdController(val snowflakeIdWorker: SnowflakeIdWorker) {

    @ApiOperation("下一个序列")
    @GetMapping("next")
    fun next(): Long {
        return snowflakeIdWorker.nextId()
    }

}